var bXmlHttpSupport = (typeof XMLHttpRequest != "undefined" || window.ActiveXObject);
   
if (typeof XMLHttpRequest == "undefined" && window.ActiveXObject){
    function XMLHttpRequest() {
        var arrSignatures = ["MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0",
                             "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP",
                             "Microsoft.XMLHTTP"];
                         
        for (var i=0; i < arrSignatures.length; i++) {
            try {        
                var oRequest = new ActiveXObject(arrSignatures[i]);            
                return oRequest;        
            } catch (oError) { /*ignore*/ }
        }          

        throw new Error("MSXML is not installed on your system.");               
    }
}
    
function sendreq(obj,sUrl) {
	if(bXmlHttpSupport){
		var oRequest = null;
		if(window.XMLHttpRequest) {
			oRequest=new XMLHttpRequest();
		}
		else if(window.ActiveXObject) {
			oRequest=new ActiveXObject("Microsoft.XMLHTTP");
		}
		oRequest.onreadystatechange = function() {
			if(oRequest.readyState == 4)
				if(oRequest.status == 200) {
					obj.innerHTML = oRequest.responseText;
				}
           };
		oRequest.open('POST', sUrl, true);
		oRequest.send(null);
	}
}

infodivId = new Array();
infodivId[0]="archiveHW";
infodivId[1]="archiveRow";
infodivId[2]="archiveLine";
infodivId[3]="archive";

function search(){
	keyObj = document.getElementById("keyText");
	ojObj = document.all.gatdocsearch[0];
	gaObj = document.all.gatdocsearch[1];
	obj = document.getElementById("content");
	obj.innerHTML = "<img alt=\"searching...\" src=\"../../resources/ele/images/roller.gif\" /> searching...";
	sendreq(obj,'/gat/ele/Warehouse.do?method=gatSearch&keyText=' + keyObj.value
		+ '&search1=' + ojObj.checked + '&search2=' + gaObj.checked);
}

function chgUserContent(i) {
	var obj = document.getElementById(infodivId[i]);
	for (var j = 0; j < infodivId.length; j++){
		var tempObj = document.getElementById(infodivId[j]);
		tempObj.style.display = 'none';
	}
	obj.style.display = 'block';
}